package com.example.demo_test.Util;

import org.jasypt.util.text.BasicTextEncryptor;

/**
 * @author zhanghong
 * @date 2021/6/14  0014 23:53
 */
public class Encryption {
    public static BasicTextEncryptor encryption = new BasicTextEncryptor();
    static {
        encryption.setPassword( "password" );
    }
//        textEncryptor.setPassword( "password" );
//    String newPassword = textEncryptor.encrypt( "爱你" );
//        System.out.println( newPassword );
//    // 解密
//    BasicTextEncryptor textEncryptor2 = new BasicTextEncryptor();
//        textEncryptor2.setPassword( "password" );
//    String oldPassword = textEncryptor2.decrypt( newPassword );
//        System.out.println( oldPassword );
//        System.out.println( "--------------------------" );
}
